using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


namespace Data.DataSources {
	public class StateFlowDataSource : ObjectDataSourceBase {
		public override string SelectViewName { get { return "v_StateFlow"; } }
		public override string InsertViewName { get { return "t_StateFlow"; } }
		public StateFlowDataSource() {
			OrderBy.Add("TableNameFrom");
			OrderBy.Add("StateFromPos");
			OrderBy.Add("Dir");
		}
		public void DeleteEx(int ID, int StateFromID, int StateToID) {
			DeleteEx(ID);
		}
		/*
		public DataView Select_StateFlows(int StateFromID,int StateToID) {
			if(StateFromID >= 0 && StateToID >= 0) throw new Exception("StateFromID and StateToID must not be provided together.");
			string filter = StateFromID >= 0 ? " WHERE StateFromID=@StateFromID" : "";
			filter = StateToID >= 0 ? " WHERE StateToID=@StateToID" : "";
			DS.SelectCommand = "SELECT * FROM v_StateFlow" + filter+" ORDER BY TableNameFrom,StateFromPos,Dir";
			return AddRowIfEmpty(DS.Select(new DataSourceSelectArguments()));
		}
		public int Delete_StateFlow(int ID,int StateFromID,int StateToID) {
			return Delete_StateFlow(ID);
		}
		public int Delete_StateFlow(int ID) {
			DS.DeleteCommand = "DELETE FROM t_StateFlow WHERE ID=@ID";
			DS.DeleteParameters.Add("ID",ID + "");
			return DS.Delete();
		}
		 */
	}
}